Left Termination of the query pattern mergesort_in_2(g, a) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PredefinedPredicateTransformerProof

Clauses:

mergesort([], []).
mergesort(.(X, []), .(X, [])).
mergesort(.(X, .(Y, Xs)), Ys) :- ','(split(.(X, .(Y, Xs)), X1s, X2s), ','(mergesort(X1s, Y1s), ','(mergesort(X2s, Y2s), merge(Y1s, Y2s, Ys)))).
split([], [], []).
split(.(X, Xs), .(X, Ys), Zs) :- split(Xs, Zs, Ys).
merge([], Xs, Xs).
merge(Xs, [], Xs).
merge(.(X, Xs), .(Y, Ys), .(X, Zs)) :- ','(=(X, Y), merge(.(X, Xs), Ys, Zs)).

Queries:

mergesort(g,a).

Added definitions of predefined predicates.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
Prolog
      ↳ PrologToPiTRSProof

Clauses:

mergesort([], []).
mergesort(.(X, []), .(X, [])).
mergesort(.(X, .(Y, Xs)), Ys) :- ','(split(.(X, .(Y, Xs)), X1s, X2s), ','(mergesort(X1s, Y1s), ','(mergesort(X2s, Y2s), merge(Y1s, Y2s, Ys)))).
split([], [], []).
split(.(X, Xs), .(X, Ys), Zs) :- split(Xs, Zs, Ys).
merge([], Xs, Xs).
merge(Xs, [], Xs).
merge(.(X, Xs), .(Y, Ys), .(X, Zs)) :- ','(=(X, Y), merge(.(X, Xs), Ys, Zs)).
=(X, X).

Queries:

mergesort(g,a).

We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

mergesort_in(.(X, .(Y, Xs)), Ys) → U1(X, Y, Xs, Ys, split_in(.(X, .(Y, Xs)), X1s, X2s))
split_in(.(X, Xs), .(X, Ys), Zs) → U5(X, Xs, Ys, Zs, split_in(Xs, Zs, Ys))
split_in([], [], []) → split_out([], [], [])
U5(X, Xs, Ys, Zs, split_out(Xs, Zs, Ys)) → split_out(.(X, Xs), .(X, Ys), Zs)
U1(X, Y, Xs, Ys, split_out(.(X, .(Y, Xs)), X1s, X2s)) → U2(X, Y, Xs, Ys, X2s, mergesort_in(X1s, Y1s))
mergesort_in(.(X, []), .(X, [])) → mergesort_out(.(X, []), .(X, []))
mergesort_in([], []) → mergesort_out([], [])
U2(X, Y, Xs, Ys, X2s, mergesort_out(X1s, Y1s)) → U3(X, Y, Xs, Ys, Y1s, mergesort_in(X2s, Y2s))
U3(X, Y, Xs, Ys, Y1s, mergesort_out(X2s, Y2s)) → U4(X, Y, Xs, Ys, merge_in(Y1s, Y2s, Ys))
merge_in(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6(X, Xs, Y, Ys, Zs, =_in(X, Y))
=_in(X, X) → =_out(X, X)
U6(X, Xs, Y, Ys, Zs, =_out(X, Y)) → U7(X, Xs, Y, Ys, Zs, merge_in(.(X, Xs), Ys, Zs))
merge_in(Xs, [], Xs) → merge_out(Xs, [], Xs)
merge_in([], Xs, Xs) → merge_out([], Xs, Xs)
U7(X, Xs, Y, Ys, Zs, merge_out(.(X, Xs), Ys, Zs)) → merge_out(.(X, Xs), .(Y, Ys), .(X, Zs))
U4(X, Y, Xs, Ys, merge_out(Y1s, Y2s, Ys)) → mergesort_out(.(X, .(Y, Xs)), Ys)

The argument filtering Pi contains the following mapping:
mergesort_in(x1, x2)  =  mergesort_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
split_in(x1, x2, x3)  =  split_in(x1)
U5(x1, x2, x3, x4, x5)  =  U5(x1, x5)
[]  =  []
split_out(x1, x2, x3)  =  split_out(x2, x3)
U2(x1, x2, x3, x4, x5, x6)  =  U2(x5, x6)
mergesort_out(x1, x2)  =  mergesort_out(x2)
U3(x1, x2, x3, x4, x5, x6)  =  U3(x5, x6)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
merge_in(x1, x2, x3)  =  merge_in(x1, x2)
U6(x1, x2, x3, x4, x5, x6)  =  U6(x1, x2, x4, x6)
=_in(x1, x2)  =  =_in(x1, x2)
=_out(x1, x2)  =  =_out
U7(x1, x2, x3, x4, x5, x6)  =  U7(x1, x6)
merge_out(x1, x2, x3)  =  merge_out(x3)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
PiTRS
          ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

mergesort_in(.(X, .(Y, Xs)), Ys) → U1(X, Y, Xs, Ys, split_in(.(X, .(Y, Xs)), X1s, X2s))
split_in(.(X, Xs), .(X, Ys), Zs) → U5(X, Xs, Ys, Zs, split_in(Xs, Zs, Ys))
split_in([], [], []) → split_out([], [], [])
U5(X, Xs, Ys, Zs, split_out(Xs, Zs, Ys)) → split_out(.(X, Xs), .(X, Ys), Zs)
U1(X, Y, Xs, Ys, split_out(.(X, .(Y, Xs)), X1s, X2s)) → U2(X, Y, Xs, Ys, X2s, mergesort_in(X1s, Y1s))
mergesort_in(.(X, []), .(X, [])) → mergesort_out(.(X, []), .(X, []))
mergesort_in([], []) → mergesort_out([], [])
U2(X, Y, Xs, Ys, X2s, mergesort_out(X1s, Y1s)) → U3(X, Y, Xs, Ys, Y1s, mergesort_in(X2s, Y2s))
U3(X, Y, Xs, Ys, Y1s, mergesort_out(X2s, Y2s)) → U4(X, Y, Xs, Ys, merge_in(Y1s, Y2s, Ys))
merge_in(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6(X, Xs, Y, Ys, Zs, =_in(X, Y))
=_in(X, X) → =_out(X, X)
U6(X, Xs, Y, Ys, Zs, =_out(X, Y)) → U7(X, Xs, Y, Ys, Zs, merge_in(.(X, Xs), Ys, Zs))
merge_in(Xs, [], Xs) → merge_out(Xs, [], Xs)
merge_in([], Xs, Xs) → merge_out([], Xs, Xs)
U7(X, Xs, Y, Ys, Zs, merge_out(.(X, Xs), Ys, Zs)) → merge_out(.(X, Xs), .(Y, Ys), .(X, Zs))
U4(X, Y, Xs, Ys, merge_out(Y1s, Y2s, Ys)) → mergesort_out(.(X, .(Y, Xs)), Ys)

The argument filtering Pi contains the following mapping:
mergesort_in(x1, x2)  =  mergesort_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
split_in(x1, x2, x3)  =  split_in(x1)
U5(x1, x2, x3, x4, x5)  =  U5(x1, x5)
[]  =  []
split_out(x1, x2, x3)  =  split_out(x2, x3)
U2(x1, x2, x3, x4, x5, x6)  =  U2(x5, x6)
mergesort_out(x1, x2)  =  mergesort_out(x2)
U3(x1, x2, x3, x4, x5, x6)  =  U3(x5, x6)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
merge_in(x1, x2, x3)  =  merge_in(x1, x2)
U6(x1, x2, x3, x4, x5, x6)  =  U6(x1, x2, x4, x6)
=_in(x1, x2)  =  =_in(x1, x2)
=_out(x1, x2)  =  =_out
U7(x1, x2, x3, x4, x5, x6)  =  U7(x1, x6)
merge_out(x1, x2, x3)  =  merge_out(x3)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

MERGESORT_IN(.(X, .(Y, Xs)), Ys) → U11(X, Y, Xs, Ys, split_in(.(X, .(Y, Xs)), X1s, X2s))
MERGESORT_IN(.(X, .(Y, Xs)), Ys) → SPLIT_IN(.(X, .(Y, Xs)), X1s, X2s)
SPLIT_IN(.(X, Xs), .(X, Ys), Zs) → U51(X, Xs, Ys, Zs, split_in(Xs, Zs, Ys))
SPLIT_IN(.(X, Xs), .(X, Ys), Zs) → SPLIT_IN(Xs, Zs, Ys)
U11(X, Y, Xs, Ys, split_out(.(X, .(Y, Xs)), X1s, X2s)) → U21(X, Y, Xs, Ys, X2s, mergesort_in(X1s, Y1s))
U11(X, Y, Xs, Ys, split_out(.(X, .(Y, Xs)), X1s, X2s)) → MERGESORT_IN(X1s, Y1s)
U21(X, Y, Xs, Ys, X2s, mergesort_out(X1s, Y1s)) → U31(X, Y, Xs, Ys, Y1s, mergesort_in(X2s, Y2s))
U21(X, Y, Xs, Ys, X2s, mergesort_out(X1s, Y1s)) → MERGESORT_IN(X2s, Y2s)
U31(X, Y, Xs, Ys, Y1s, mergesort_out(X2s, Y2s)) → U41(X, Y, Xs, Ys, merge_in(Y1s, Y2s, Ys))
U31(X, Y, Xs, Ys, Y1s, mergesort_out(X2s, Y2s)) → MERGE_IN(Y1s, Y2s, Ys)
MERGE_IN(.(X, Xs), .(Y, Ys), .(X, Zs)) → U61(X, Xs, Y, Ys, Zs, =_in(X, Y))
MERGE_IN(.(X, Xs), .(Y, Ys), .(X, Zs)) → =_IN(X, Y)
U61(X, Xs, Y, Ys, Zs, =_out(X, Y)) → U71(X, Xs, Y, Ys, Zs, merge_in(.(X, Xs), Ys, Zs))
U61(X, Xs, Y, Ys, Zs, =_out(X, Y)) → MERGE_IN(.(X, Xs), Ys, Zs)

The TRS R consists of the following rules:

mergesort_in(.(X, .(Y, Xs)), Ys) → U1(X, Y, Xs, Ys, split_in(.(X, .(Y, Xs)), X1s, X2s))
split_in(.(X, Xs), .(X, Ys), Zs) → U5(X, Xs, Ys, Zs, split_in(Xs, Zs, Ys))
split_in([], [], []) → split_out([], [], [])
U5(X, Xs, Ys, Zs, split_out(Xs, Zs, Ys)) → split_out(.(X, Xs), .(X, Ys), Zs)
U1(X, Y, Xs, Ys, split_out(.(X, .(Y, Xs)), X1s, X2s)) → U2(X, Y, Xs, Ys, X2s, mergesort_in(X1s, Y1s))
mergesort_in(.(X, []), .(X, [])) → mergesort_out(.(X, []), .(X, []))
mergesort_in([], []) → mergesort_out([], [])
U2(X, Y, Xs, Ys, X2s, mergesort_out(X1s, Y1s)) → U3(X, Y, Xs, Ys, Y1s, mergesort_in(X2s, Y2s))
U3(X, Y, Xs, Ys, Y1s, mergesort_out(X2s, Y2s)) → U4(X, Y, Xs, Ys, merge_in(Y1s, Y2s, Ys))
merge_in(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6(X, Xs, Y, Ys, Zs, =_in(X, Y))
=_in(X, X) → =_out(X, X)
U6(X, Xs, Y, Ys, Zs, =_out(X, Y)) → U7(X, Xs, Y, Ys, Zs, merge_in(.(X, Xs), Ys, Zs))
merge_in(Xs, [], Xs) → merge_out(Xs, [], Xs)
merge_in([], Xs, Xs) → merge_out([], Xs, Xs)
U7(X, Xs, Y, Ys, Zs, merge_out(.(X, Xs), Ys, Zs)) → merge_out(.(X, Xs), .(Y, Ys), .(X, Zs))
U4(X, Y, Xs, Ys, merge_out(Y1s, Y2s, Ys)) → mergesort_out(.(X, .(Y, Xs)), Ys)

The argument filtering Pi contains the following mapping:
mergesort_in(x1, x2)  =  mergesort_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
split_in(x1, x2, x3)  =  split_in(x1)
U5(x1, x2, x3, x4, x5)  =  U5(x1, x5)
[]  =  []
split_out(x1, x2, x3)  =  split_out(x2, x3)
U2(x1, x2, x3, x4, x5, x6)  =  U2(x5, x6)
mergesort_out(x1, x2)  =  mergesort_out(x2)
U3(x1, x2, x3, x4, x5, x6)  =  U3(x5, x6)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
merge_in(x1, x2, x3)  =  merge_in(x1, x2)
U6(x1, x2, x3, x4, x5, x6)  =  U6(x1, x2, x4, x6)
=_in(x1, x2)  =  =_in(x1, x2)
=_out(x1, x2)  =  =_out
U7(x1, x2, x3, x4, x5, x6)  =  U7(x1, x6)
merge_out(x1, x2, x3)  =  merge_out(x3)
SPLIT_IN(x1, x2, x3)  =  SPLIT_IN(x1)
=_IN(x1, x2)  =  =_IN(x1, x2)
MERGE_IN(x1, x2, x3)  =  MERGE_IN(x1, x2)
U51(x1, x2, x3, x4, x5)  =  U51(x1, x5)
U41(x1, x2, x3, x4, x5)  =  U41(x5)
U21(x1, x2, x3, x4, x5, x6)  =  U21(x5, x6)
U11(x1, x2, x3, x4, x5)  =  U11(x5)
U31(x1, x2, x3, x4, x5, x6)  =  U31(x5, x6)
U71(x1, x2, x3, x4, x5, x6)  =  U71(x1, x6)
U61(x1, x2, x3, x4, x5, x6)  =  U61(x1, x2, x4, x6)
MERGESORT_IN(x1, x2)  =  MERGESORT_IN(x1)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
PiDP
              ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

MERGESORT_IN(.(X, .(Y, Xs)), Ys) → U11(X, Y, Xs, Ys, split_in(.(X, .(Y, Xs)), X1s, X2s))
MERGESORT_IN(.(X, .(Y, Xs)), Ys) → SPLIT_IN(.(X, .(Y, Xs)), X1s, X2s)
SPLIT_IN(.(X, Xs), .(X, Ys), Zs) → U51(X, Xs, Ys, Zs, split_in(Xs, Zs, Ys))
SPLIT_IN(.(X, Xs), .(X, Ys), Zs) → SPLIT_IN(Xs, Zs, Ys)
U11(X, Y, Xs, Ys, split_out(.(X, .(Y, Xs)), X1s, X2s)) → U21(X, Y, Xs, Ys, X2s, mergesort_in(X1s, Y1s))
U11(X, Y, Xs, Ys, split_out(.(X, .(Y, Xs)), X1s, X2s)) → MERGESORT_IN(X1s, Y1s)
U21(X, Y, Xs, Ys, X2s, mergesort_out(X1s, Y1s)) → U31(X, Y, Xs, Ys, Y1s, mergesort_in(X2s, Y2s))
U21(X, Y, Xs, Ys, X2s, mergesort_out(X1s, Y1s)) → MERGESORT_IN(X2s, Y2s)
U31(X, Y, Xs, Ys, Y1s, mergesort_out(X2s, Y2s)) → U41(X, Y, Xs, Ys, merge_in(Y1s, Y2s, Ys))
U31(X, Y, Xs, Ys, Y1s, mergesort_out(X2s, Y2s)) → MERGE_IN(Y1s, Y2s, Ys)
MERGE_IN(.(X, Xs), .(Y, Ys), .(X, Zs)) → U61(X, Xs, Y, Ys, Zs, =_in(X, Y))
MERGE_IN(.(X, Xs), .(Y, Ys), .(X, Zs)) → =_IN(X, Y)
U61(X, Xs, Y, Ys, Zs, =_out(X, Y)) → U71(X, Xs, Y, Ys, Zs, merge_in(.(X, Xs), Ys, Zs))
U61(X, Xs, Y, Ys, Zs, =_out(X, Y)) → MERGE_IN(.(X, Xs), Ys, Zs)

The TRS R consists of the following rules:

mergesort_in(.(X, .(Y, Xs)), Ys) → U1(X, Y, Xs, Ys, split_in(.(X, .(Y, Xs)), X1s, X2s))
split_in(.(X, Xs), .(X, Ys), Zs) → U5(X, Xs, Ys, Zs, split_in(Xs, Zs, Ys))
split_in([], [], []) → split_out([], [], [])
U5(X, Xs, Ys, Zs, split_out(Xs, Zs, Ys)) → split_out(.(X, Xs), .(X, Ys), Zs)
U1(X, Y, Xs, Ys, split_out(.(X, .(Y, Xs)), X1s, X2s)) → U2(X, Y, Xs, Ys, X2s, mergesort_in(X1s, Y1s))
mergesort_in(.(X, []), .(X, [])) → mergesort_out(.(X, []), .(X, []))
mergesort_in([], []) → mergesort_out([], [])
U2(X, Y, Xs, Ys, X2s, mergesort_out(X1s, Y1s)) → U3(X, Y, Xs, Ys, Y1s, mergesort_in(X2s, Y2s))
U3(X, Y, Xs, Ys, Y1s, mergesort_out(X2s, Y2s)) → U4(X, Y, Xs, Ys, merge_in(Y1s, Y2s, Ys))
merge_in(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6(X, Xs, Y, Ys, Zs, =_in(X, Y))
=_in(X, X) → =_out(X, X)
U6(X, Xs, Y, Ys, Zs, =_out(X, Y)) → U7(X, Xs, Y, Ys, Zs, merge_in(.(X, Xs), Ys, Zs))
merge_in(Xs, [], Xs) → merge_out(Xs, [], Xs)
merge_in([], Xs, Xs) → merge_out([], Xs, Xs)
U7(X, Xs, Y, Ys, Zs, merge_out(.(X, Xs), Ys, Zs)) → merge_out(.(X, Xs), .(Y, Ys), .(X, Zs))
U4(X, Y, Xs, Ys, merge_out(Y1s, Y2s, Ys)) → mergesort_out(.(X, .(Y, Xs)), Ys)

The argument filtering Pi contains the following mapping:
mergesort_in(x1, x2)  =  mergesort_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
split_in(x1, x2, x3)  =  split_in(x1)
U5(x1, x2, x3, x4, x5)  =  U5(x1, x5)
[]  =  []
split_out(x1, x2, x3)  =  split_out(x2, x3)
U2(x1, x2, x3, x4, x5, x6)  =  U2(x5, x6)
mergesort_out(x1, x2)  =  mergesort_out(x2)
U3(x1, x2, x3, x4, x5, x6)  =  U3(x5, x6)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
merge_in(x1, x2, x3)  =  merge_in(x1, x2)
U6(x1, x2, x3, x4, x5, x6)  =  U6(x1, x2, x4, x6)
=_in(x1, x2)  =  =_in(x1, x2)
=_out(x1, x2)  =  =_out
U7(x1, x2, x3, x4, x5, x6)  =  U7(x1, x6)
merge_out(x1, x2, x3)  =  merge_out(x3)
SPLIT_IN(x1, x2, x3)  =  SPLIT_IN(x1)
=_IN(x1, x2)  =  =_IN(x1, x2)
MERGE_IN(x1, x2, x3)  =  MERGE_IN(x1, x2)
U51(x1, x2, x3, x4, x5)  =  U51(x1, x5)
U41(x1, x2, x3, x4, x5)  =  U41(x5)
U21(x1, x2, x3, x4, x5, x6)  =  U21(x5, x6)
U11(x1, x2, x3, x4, x5)  =  U11(x5)
U31(x1, x2, x3, x4, x5, x6)  =  U31(x5, x6)
U71(x1, x2, x3, x4, x5, x6)  =  U71(x1, x6)
U61(x1, x2, x3, x4, x5, x6)  =  U61(x1, x2, x4, x6)
MERGESORT_IN(x1, x2)  =  MERGESORT_IN(x1)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 3 SCCs with 7 less nodes.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
PiDP
                    ↳ UsableRulesProof
                  ↳ PiDP
                  ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

MERGE_IN(.(X, Xs), .(Y, Ys), .(X, Zs)) → U61(X, Xs, Y, Ys, Zs, =_in(X, Y))
U61(X, Xs, Y, Ys, Zs, =_out(X, Y)) → MERGE_IN(.(X, Xs), Ys, Zs)

The TRS R consists of the following rules:

mergesort_in(.(X, .(Y, Xs)), Ys) → U1(X, Y, Xs, Ys, split_in(.(X, .(Y, Xs)), X1s, X2s))
split_in(.(X, Xs), .(X, Ys), Zs) → U5(X, Xs, Ys, Zs, split_in(Xs, Zs, Ys))
split_in([], [], []) → split_out([], [], [])
U5(X, Xs, Ys, Zs, split_out(Xs, Zs, Ys)) → split_out(.(X, Xs), .(X, Ys), Zs)
U1(X, Y, Xs, Ys, split_out(.(X, .(Y, Xs)), X1s, X2s)) → U2(X, Y, Xs, Ys, X2s, mergesort_in(X1s, Y1s))
mergesort_in(.(X, []), .(X, [])) → mergesort_out(.(X, []), .(X, []))
mergesort_in([], []) → mergesort_out([], [])
U2(X, Y, Xs, Ys, X2s, mergesort_out(X1s, Y1s)) → U3(X, Y, Xs, Ys, Y1s, mergesort_in(X2s, Y2s))
U3(X, Y, Xs, Ys, Y1s, mergesort_out(X2s, Y2s)) → U4(X, Y, Xs, Ys, merge_in(Y1s, Y2s, Ys))
merge_in(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6(X, Xs, Y, Ys, Zs, =_in(X, Y))
=_in(X, X) → =_out(X, X)
U6(X, Xs, Y, Ys, Zs, =_out(X, Y)) → U7(X, Xs, Y, Ys, Zs, merge_in(.(X, Xs), Ys, Zs))
merge_in(Xs, [], Xs) → merge_out(Xs, [], Xs)
merge_in([], Xs, Xs) → merge_out([], Xs, Xs)
U7(X, Xs, Y, Ys, Zs, merge_out(.(X, Xs), Ys, Zs)) → merge_out(.(X, Xs), .(Y, Ys), .(X, Zs))
U4(X, Y, Xs, Ys, merge_out(Y1s, Y2s, Ys)) → mergesort_out(.(X, .(Y, Xs)), Ys)

The argument filtering Pi contains the following mapping:
mergesort_in(x1, x2)  =  mergesort_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
split_in(x1, x2, x3)  =  split_in(x1)
U5(x1, x2, x3, x4, x5)  =  U5(x1, x5)
[]  =  []
split_out(x1, x2, x3)  =  split_out(x2, x3)
U2(x1, x2, x3, x4, x5, x6)  =  U2(x5, x6)
mergesort_out(x1, x2)  =  mergesort_out(x2)
U3(x1, x2, x3, x4, x5, x6)  =  U3(x5, x6)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
merge_in(x1, x2, x3)  =  merge_in(x1, x2)
U6(x1, x2, x3, x4, x5, x6)  =  U6(x1, x2, x4, x6)
=_in(x1, x2)  =  =_in(x1, x2)
=_out(x1, x2)  =  =_out
U7(x1, x2, x3, x4, x5, x6)  =  U7(x1, x6)
merge_out(x1, x2, x3)  =  merge_out(x3)
MERGE_IN(x1, x2, x3)  =  MERGE_IN(x1, x2)
U61(x1, x2, x3, x4, x5, x6)  =  U61(x1, x2, x4, x6)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                    ↳ UsableRulesProof
PiDP
                        ↳ PiDPToQDPProof
                  ↳ PiDP
                  ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

MERGE_IN(.(X, Xs), .(Y, Ys), .(X, Zs)) → U61(X, Xs, Y, Ys, Zs, =_in(X, Y))
U61(X, Xs, Y, Ys, Zs, =_out(X, Y)) → MERGE_IN(.(X, Xs), Ys, Zs)

The TRS R consists of the following rules:

=_in(X, X) → =_out(X, X)

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
=_in(x1, x2)  =  =_in(x1, x2)
=_out(x1, x2)  =  =_out
MERGE_IN(x1, x2, x3)  =  MERGE_IN(x1, x2)
U61(x1, x2, x3, x4, x5, x6)  =  U61(x1, x2, x4, x6)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                    ↳ UsableRulesProof
                      ↳ PiDP
                        ↳ PiDPToQDPProof
QDP
                            ↳ QDPSizeChangeProof
                  ↳ PiDP
                  ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

MERGE_IN(.(X, Xs), .(Y, Ys)) → U61(X, Xs, Ys, =_in(X, Y))
U61(X, Xs, Ys, =_out) → MERGE_IN(.(X, Xs), Ys)

The TRS R consists of the following rules:

=_in(X, X) → =_out

The set Q consists of the following terms:

=_in(x0, x1)

We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
PiDP
                    ↳ UsableRulesProof
                  ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

SPLIT_IN(.(X, Xs), .(X, Ys), Zs) → SPLIT_IN(Xs, Zs, Ys)

The TRS R consists of the following rules:

mergesort_in(.(X, .(Y, Xs)), Ys) → U1(X, Y, Xs, Ys, split_in(.(X, .(Y, Xs)), X1s, X2s))
split_in(.(X, Xs), .(X, Ys), Zs) → U5(X, Xs, Ys, Zs, split_in(Xs, Zs, Ys))
split_in([], [], []) → split_out([], [], [])
U5(X, Xs, Ys, Zs, split_out(Xs, Zs, Ys)) → split_out(.(X, Xs), .(X, Ys), Zs)
U1(X, Y, Xs, Ys, split_out(.(X, .(Y, Xs)), X1s, X2s)) → U2(X, Y, Xs, Ys, X2s, mergesort_in(X1s, Y1s))
mergesort_in(.(X, []), .(X, [])) → mergesort_out(.(X, []), .(X, []))
mergesort_in([], []) → mergesort_out([], [])
U2(X, Y, Xs, Ys, X2s, mergesort_out(X1s, Y1s)) → U3(X, Y, Xs, Ys, Y1s, mergesort_in(X2s, Y2s))
U3(X, Y, Xs, Ys, Y1s, mergesort_out(X2s, Y2s)) → U4(X, Y, Xs, Ys, merge_in(Y1s, Y2s, Ys))
merge_in(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6(X, Xs, Y, Ys, Zs, =_in(X, Y))
=_in(X, X) → =_out(X, X)
U6(X, Xs, Y, Ys, Zs, =_out(X, Y)) → U7(X, Xs, Y, Ys, Zs, merge_in(.(X, Xs), Ys, Zs))
merge_in(Xs, [], Xs) → merge_out(Xs, [], Xs)
merge_in([], Xs, Xs) → merge_out([], Xs, Xs)
U7(X, Xs, Y, Ys, Zs, merge_out(.(X, Xs), Ys, Zs)) → merge_out(.(X, Xs), .(Y, Ys), .(X, Zs))
U4(X, Y, Xs, Ys, merge_out(Y1s, Y2s, Ys)) → mergesort_out(.(X, .(Y, Xs)), Ys)

The argument filtering Pi contains the following mapping:
mergesort_in(x1, x2)  =  mergesort_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
split_in(x1, x2, x3)  =  split_in(x1)
U5(x1, x2, x3, x4, x5)  =  U5(x1, x5)
[]  =  []
split_out(x1, x2, x3)  =  split_out(x2, x3)
U2(x1, x2, x3, x4, x5, x6)  =  U2(x5, x6)
mergesort_out(x1, x2)  =  mergesort_out(x2)
U3(x1, x2, x3, x4, x5, x6)  =  U3(x5, x6)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
merge_in(x1, x2, x3)  =  merge_in(x1, x2)
U6(x1, x2, x3, x4, x5, x6)  =  U6(x1, x2, x4, x6)
=_in(x1, x2)  =  =_in(x1, x2)
=_out(x1, x2)  =  =_out
U7(x1, x2, x3, x4, x5, x6)  =  U7(x1, x6)
merge_out(x1, x2, x3)  =  merge_out(x3)
SPLIT_IN(x1, x2, x3)  =  SPLIT_IN(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                    ↳ UsableRulesProof
PiDP
                        ↳ PiDPToQDPProof
                  ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

SPLIT_IN(.(X, Xs), .(X, Ys), Zs) → SPLIT_IN(Xs, Zs, Ys)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
SPLIT_IN(x1, x2, x3)  =  SPLIT_IN(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                    ↳ UsableRulesProof
                      ↳ PiDP
                        ↳ PiDPToQDPProof
QDP
                            ↳ QDPSizeChangeProof
                  ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

SPLIT_IN(.(X, Xs)) → SPLIT_IN(Xs)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

MERGESORT_IN(.(X, .(Y, Xs)), Ys) → U11(X, Y, Xs, Ys, split_in(.(X, .(Y, Xs)), X1s, X2s))
U11(X, Y, Xs, Ys, split_out(.(X, .(Y, Xs)), X1s, X2s)) → MERGESORT_IN(X1s, Y1s)
U21(X, Y, Xs, Ys, X2s, mergesort_out(X1s, Y1s)) → MERGESORT_IN(X2s, Y2s)
U11(X, Y, Xs, Ys, split_out(.(X, .(Y, Xs)), X1s, X2s)) → U21(X, Y, Xs, Ys, X2s, mergesort_in(X1s, Y1s))

The TRS R consists of the following rules:

mergesort_in(.(X, .(Y, Xs)), Ys) → U1(X, Y, Xs, Ys, split_in(.(X, .(Y, Xs)), X1s, X2s))
split_in(.(X, Xs), .(X, Ys), Zs) → U5(X, Xs, Ys, Zs, split_in(Xs, Zs, Ys))
split_in([], [], []) → split_out([], [], [])
U5(X, Xs, Ys, Zs, split_out(Xs, Zs, Ys)) → split_out(.(X, Xs), .(X, Ys), Zs)
U1(X, Y, Xs, Ys, split_out(.(X, .(Y, Xs)), X1s, X2s)) → U2(X, Y, Xs, Ys, X2s, mergesort_in(X1s, Y1s))
mergesort_in(.(X, []), .(X, [])) → mergesort_out(.(X, []), .(X, []))
mergesort_in([], []) → mergesort_out([], [])
U2(X, Y, Xs, Ys, X2s, mergesort_out(X1s, Y1s)) → U3(X, Y, Xs, Ys, Y1s, mergesort_in(X2s, Y2s))
U3(X, Y, Xs, Ys, Y1s, mergesort_out(X2s, Y2s)) → U4(X, Y, Xs, Ys, merge_in(Y1s, Y2s, Ys))
merge_in(.(X, Xs), .(Y, Ys), .(X, Zs)) → U6(X, Xs, Y, Ys, Zs, =_in(X, Y))
=_in(X, X) → =_out(X, X)
U6(X, Xs, Y, Ys, Zs, =_out(X, Y)) → U7(X, Xs, Y, Ys, Zs, merge_in(.(X, Xs), Ys, Zs))
merge_in(Xs, [], Xs) → merge_out(Xs, [], Xs)
merge_in([], Xs, Xs) → merge_out([], Xs, Xs)
U7(X, Xs, Y, Ys, Zs, merge_out(.(X, Xs), Ys, Zs)) → merge_out(.(X, Xs), .(Y, Ys), .(X, Zs))
U4(X, Y, Xs, Ys, merge_out(Y1s, Y2s, Ys)) → mergesort_out(.(X, .(Y, Xs)), Ys)

The argument filtering Pi contains the following mapping:
mergesort_in(x1, x2)  =  mergesort_in(x1)
.(x1, x2)  =  .(x1, x2)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
split_in(x1, x2, x3)  =  split_in(x1)
U5(x1, x2, x3, x4, x5)  =  U5(x1, x5)
[]  =  []
split_out(x1, x2, x3)  =  split_out(x2, x3)
U2(x1, x2, x3, x4, x5, x6)  =  U2(x5, x6)
mergesort_out(x1, x2)  =  mergesort_out(x2)
U3(x1, x2, x3, x4, x5, x6)  =  U3(x5, x6)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
merge_in(x1, x2, x3)  =  merge_in(x1, x2)
U6(x1, x2, x3, x4, x5, x6)  =  U6(x1, x2, x4, x6)
=_in(x1, x2)  =  =_in(x1, x2)
=_out(x1, x2)  =  =_out
U7(x1, x2, x3, x4, x5, x6)  =  U7(x1, x6)
merge_out(x1, x2, x3)  =  merge_out(x3)
U21(x1, x2, x3, x4, x5, x6)  =  U21(x5, x6)
U11(x1, x2, x3, x4, x5)  =  U11(x5)
MERGESORT_IN(x1, x2)  =  MERGESORT_IN(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ Rewriting

Q DP problem:
The TRS P consists of the following rules:

U21(X2s, mergesort_out(Y1s)) → MERGESORT_IN(X2s)
U11(split_out(X1s, X2s)) → MERGESORT_IN(X1s)
MERGESORT_IN(.(X, .(Y, Xs))) → U11(split_in(.(X, .(Y, Xs))))
U11(split_out(X1s, X2s)) → U21(X2s, mergesort_in(X1s))

The TRS R consists of the following rules:

mergesort_in(.(X, .(Y, Xs))) → U1(split_in(.(X, .(Y, Xs))))
split_in(.(X, Xs)) → U5(X, split_in(Xs))
split_in([]) → split_out([], [])
U5(X, split_out(Zs, Ys)) → split_out(.(X, Ys), Zs)
U1(split_out(X1s, X2s)) → U2(X2s, mergesort_in(X1s))
mergesort_in(.(X, [])) → mergesort_out(.(X, []))
mergesort_in([]) → mergesort_out([])
U2(X2s, mergesort_out(Y1s)) → U3(Y1s, mergesort_in(X2s))
U3(Y1s, mergesort_out(Y2s)) → U4(merge_in(Y1s, Y2s))
merge_in(.(X, Xs), .(Y, Ys)) → U6(X, Xs, Ys, =_in(X, Y))
=_in(X, X) → =_out
U6(X, Xs, Ys, =_out) → U7(X, merge_in(.(X, Xs), Ys))
merge_in(Xs, []) → merge_out(Xs)
merge_in([], Xs) → merge_out(Xs)
U7(X, merge_out(Zs)) → merge_out(.(X, Zs))
U4(merge_out(Ys)) → mergesort_out(Ys)

The set Q consists of the following terms:

mergesort_in(x0)
split_in(x0)
U5(x0, x1)
U1(x0)
U2(x0, x1)
U3(x0, x1)
merge_in(x0, x1)
=_in(x0, x1)
U6(x0, x1, x2, x3)
U7(x0, x1)
U4(x0)

We have to consider all (P,Q,R)-chains.
By rewriting [15] the rule MERGESORT_IN(.(X, .(Y, Xs))) → U11(split_in(.(X, .(Y, Xs)))) at position [0] we obtained the following new rules:

MERGESORT_IN(.(X, .(Y, Xs))) → U11(U5(X, split_in(.(Y, Xs))))



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Rewriting
QDP
                            ↳ Rewriting

Q DP problem:
The TRS P consists of the following rules:

U11(split_out(X1s, X2s)) → MERGESORT_IN(X1s)
U21(X2s, mergesort_out(Y1s)) → MERGESORT_IN(X2s)
U11(split_out(X1s, X2s)) → U21(X2s, mergesort_in(X1s))
MERGESORT_IN(.(X, .(Y, Xs))) → U11(U5(X, split_in(.(Y, Xs))))

The TRS R consists of the following rules:

mergesort_in(.(X, .(Y, Xs))) → U1(split_in(.(X, .(Y, Xs))))
split_in(.(X, Xs)) → U5(X, split_in(Xs))
split_in([]) → split_out([], [])
U5(X, split_out(Zs, Ys)) → split_out(.(X, Ys), Zs)
U1(split_out(X1s, X2s)) → U2(X2s, mergesort_in(X1s))
mergesort_in(.(X, [])) → mergesort_out(.(X, []))
mergesort_in([]) → mergesort_out([])
U2(X2s, mergesort_out(Y1s)) → U3(Y1s, mergesort_in(X2s))
U3(Y1s, mergesort_out(Y2s)) → U4(merge_in(Y1s, Y2s))
merge_in(.(X, Xs), .(Y, Ys)) → U6(X, Xs, Ys, =_in(X, Y))
=_in(X, X) → =_out
U6(X, Xs, Ys, =_out) → U7(X, merge_in(.(X, Xs), Ys))
merge_in(Xs, []) → merge_out(Xs)
merge_in([], Xs) → merge_out(Xs)
U7(X, merge_out(Zs)) → merge_out(.(X, Zs))
U4(merge_out(Ys)) → mergesort_out(Ys)

The set Q consists of the following terms:

mergesort_in(x0)
split_in(x0)
U5(x0, x1)
U1(x0)
U2(x0, x1)
U3(x0, x1)
merge_in(x0, x1)
=_in(x0, x1)
U6(x0, x1, x2, x3)
U7(x0, x1)
U4(x0)

We have to consider all (P,Q,R)-chains.
By rewriting [15] the rule MERGESORT_IN(.(X, .(Y, Xs))) → U11(U5(X, split_in(.(Y, Xs)))) at position [0,1] we obtained the following new rules:

MERGESORT_IN(.(X, .(Y, Xs))) → U11(U5(X, U5(Y, split_in(Xs))))



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Rewriting
                          ↳ QDP
                            ↳ Rewriting
QDP
                                ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

U21(X2s, mergesort_out(Y1s)) → MERGESORT_IN(X2s)
U11(split_out(X1s, X2s)) → MERGESORT_IN(X1s)
U11(split_out(X1s, X2s)) → U21(X2s, mergesort_in(X1s))
MERGESORT_IN(.(X, .(Y, Xs))) → U11(U5(X, U5(Y, split_in(Xs))))

The TRS R consists of the following rules:

mergesort_in(.(X, .(Y, Xs))) → U1(split_in(.(X, .(Y, Xs))))
split_in(.(X, Xs)) → U5(X, split_in(Xs))
split_in([]) → split_out([], [])
U5(X, split_out(Zs, Ys)) → split_out(.(X, Ys), Zs)
U1(split_out(X1s, X2s)) → U2(X2s, mergesort_in(X1s))
mergesort_in(.(X, [])) → mergesort_out(.(X, []))
mergesort_in([]) → mergesort_out([])
U2(X2s, mergesort_out(Y1s)) → U3(Y1s, mergesort_in(X2s))
U3(Y1s, mergesort_out(Y2s)) → U4(merge_in(Y1s, Y2s))
merge_in(.(X, Xs), .(Y, Ys)) → U6(X, Xs, Ys, =_in(X, Y))
=_in(X, X) → =_out
U6(X, Xs, Ys, =_out) → U7(X, merge_in(.(X, Xs), Ys))
merge_in(Xs, []) → merge_out(Xs)
merge_in([], Xs) → merge_out(Xs)
U7(X, merge_out(Zs)) → merge_out(.(X, Zs))
U4(merge_out(Ys)) → mergesort_out(Ys)

The set Q consists of the following terms:

mergesort_in(x0)
split_in(x0)
U5(x0, x1)
U1(x0)
U2(x0, x1)
U3(x0, x1)
merge_in(x0, x1)
=_in(x0, x1)
U6(x0, x1, x2, x3)
U7(x0, x1)
U4(x0)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


MERGESORT_IN(.(X, .(Y, Xs))) → U11(U5(X, U5(Y, split_in(Xs))))
The remaining pairs can at least be oriented weakly.

U21(X2s, mergesort_out(Y1s)) → MERGESORT_IN(X2s)
U11(split_out(X1s, X2s)) → MERGESORT_IN(X1s)
U11(split_out(X1s, X2s)) → U21(X2s, mergesort_in(X1s))
Used ordering: Matrix interpretation [3]:
Non-tuple symbols:
M( split_in(x1) ) =
/0\
\1/
+
/10\
\01/
·x1

M( [] ) =
/0\
\0/

M( U1(x1) ) =
/0\
\0/
+
/00\
\00/
·x1

M( U3(x1, x2) ) =
/0\
\0/
+
/00\
\00/
·x1+
/00\
\00/
·x2

M( .(x1, x2) ) =
/1\
\0/
+
/00\
\00/
·x1+
/11\
\10/
·x2

M( split_out(x1, x2) ) =
/0\
\1/
+
/11\
\00/
·x1+
/11\
\10/
·x2

M( U2(x1, x2) ) =
/0\
\0/
+
/00\
\00/
·x1+
/00\
\00/
·x2

M( merge_out(x1) ) =
/0\
\0/
+
/00\
\00/
·x1

M( U5(x1, x2) ) =
/0\
\1/
+
/00\
\00/
·x1+
/11\
\10/
·x2

M( =_in(x1, x2) ) =
/1\
\1/
+
/00\
\00/
·x1+
/00\
\00/
·x2

M( U7(x1, x2) ) =
/0\
\0/
+
/00\
\00/
·x1+
/00\
\00/
·x2

M( merge_in(x1, x2) ) =
/0\
\0/
+
/00\
\00/
·x1+
/00\
\00/
·x2

M( U4(x1) ) =
/0\
\0/
+
/00\
\00/
·x1

M( mergesort_in(x1) ) =
/0\
\0/
+
/00\
\00/
·x1

M( mergesort_out(x1) ) =
/0\
\0/
+
/00\
\00/
·x1

M( U6(x1, ..., x4) ) =
/0\
\0/
+
/00\
\00/
·x1+
/00\
\00/
·x2+
/00\
\00/
·x3+
/00\
\00/
·x4

M( =_out ) =
/0\
\1/

Tuple symbols:
M( U11(x1) ) = 0+
[1,0]
·x1

M( MERGESORT_IN(x1) ) = 0+
[1,1]
·x1

M( U21(x1, x2) ) = 0+
[1,1]
·x1+
[0,0]
·x2


Matrix type:
We used a basic matrix type which is not further parametrizeable.


As matrix orders are CE-compatible, we used usable rules w.r.t. argument filtering in the order.
The following usable rules [17] were oriented:

U5(X, split_out(Zs, Ys)) → split_out(.(X, Ys), Zs)
split_in([]) → split_out([], [])
split_in(.(X, Xs)) → U5(X, split_in(Xs))
=_in(X, X) → =_out



↳ Prolog
  ↳ PredefinedPredicateTransformerProof
    ↳ Prolog
      ↳ PrologToPiTRSProof
        ↳ PiTRS
          ↳ DependencyPairsProof
            ↳ PiDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ PiDP
                  ↳ PiDP
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Rewriting
                          ↳ QDP
                            ↳ Rewriting
                              ↳ QDP
                                ↳ QDPOrderProof
QDP
                                    ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

U11(split_out(X1s, X2s)) → MERGESORT_IN(X1s)
U21(X2s, mergesort_out(Y1s)) → MERGESORT_IN(X2s)
U11(split_out(X1s, X2s)) → U21(X2s, mergesort_in(X1s))

The TRS R consists of the following rules:

mergesort_in(.(X, .(Y, Xs))) → U1(split_in(.(X, .(Y, Xs))))
split_in(.(X, Xs)) → U5(X, split_in(Xs))
split_in([]) → split_out([], [])
U5(X, split_out(Zs, Ys)) → split_out(.(X, Ys), Zs)
U1(split_out(X1s, X2s)) → U2(X2s, mergesort_in(X1s))
mergesort_in(.(X, [])) → mergesort_out(.(X, []))
mergesort_in([]) → mergesort_out([])
U2(X2s, mergesort_out(Y1s)) → U3(Y1s, mergesort_in(X2s))
U3(Y1s, mergesort_out(Y2s)) → U4(merge_in(Y1s, Y2s))
merge_in(.(X, Xs), .(Y, Ys)) → U6(X, Xs, Ys, =_in(X, Y))
=_in(X, X) → =_out
U6(X, Xs, Ys, =_out) → U7(X, merge_in(.(X, Xs), Ys))
merge_in(Xs, []) → merge_out(Xs)
merge_in([], Xs) → merge_out(Xs)
U7(X, merge_out(Zs)) → merge_out(.(X, Zs))
U4(merge_out(Ys)) → mergesort_out(Ys)

The set Q consists of the following terms:

mergesort_in(x0)
split_in(x0)
U5(x0, x1)
U1(x0)
U2(x0, x1)
U3(x0, x1)
merge_in(x0, x1)
=_in(x0, x1)
U6(x0, x1, x2, x3)
U7(x0, x1)
U4(x0)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 0 SCCs with 3 less nodes.